package com.soap.controller;

import com.soap.entity.query.GoodsQuery;
import com.soap.service.GoodsSearchService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by ZhangPY on 2021/1/24
 * Belong Organization OVERUN-9299
 * overun9299@163.com
 * Explain: GoodsSearchController
 */
@RestController
@Api(value = "商品模块" , tags = "商品模块")
@RequestMapping(value = "/goods")
public class GoodsSearchController {

    @Autowired
    private GoodsSearchService goodsSearchService;

    /**
     * 获取京东数据，并打入es
     * @param keyWord
     * @return
     */
    @GetMapping("/getJDInfoToES")
    public String getJDInfoToES(String keyWord) {
        return goodsSearchService.getJDInfoToES(keyWord);
    }

    /**
     * 查询Goods
     * @param goodsQuery
     * @return
     */
    @RequestMapping("/queryESGoodsList")
    public String queryESGoodsList(GoodsQuery goodsQuery) {
        return goodsSearchService.queryESGoodsList(goodsQuery);
    }

}
